|
In Unix-like computer operating systems (and, to some extent, Microsoft Windows), a pipeline is a set of processes chained by their standard streams, so that the output of each process (''stdout'') feeds directly as input (''stdin'') to the next one. Filter programs are often used in this configuration. The concept of pipelines was invented by Douglas McIlroy at Unix's ancestral home of Bell Labs, prior to the actual invention of the operating system, and implemented in Unix at his insistence, shaping its toolbox philosophy.〔http://cm.bell-labs.com/cm/cs/who/dmr/mdmpipe.html〕 It is named by analogy to a physical pipeline. The standard shell syntax for pipelines is to list multiple programs to invoke in one command, separated by vertical bars: program1 | program2 | program3 Each program is assumed to take input and give output on its ''standard streams''. Each "" tells the shell to connect the standard output of the left program to the standard input of the right program by an inter-process communication mechanism called an (anonymous) pipe, implemented in the operating system. Since pipes are unidirectional, data flows through the pipeline from left to right. For example, to list files in the current directory (), retain only the lines of output containing the string (), and view the result in a scrolling page (), one can issue the command: ls -l | grep key | less == Pipelines in command line interfaces == All widely used Unix and Windows shells have a special syntax construct for the creation of pipelines. In all usage one writes the filter commands in sequence, separated by the ASCII vertical bar character " | " (which, for this reason, is often called "pipe character"). The shell starts the processes and arranges for the necessary connections between their standard streams (including some amount of buffer storage). 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Pipeline (Unix)」の詳細全文を読む スポンサード リンク
|